package com.ruoyi.rural.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rural.mapper.RuralVaccineAppointmentMapper;
import com.ruoyi.rural.domain.RuralVaccineAppointment;
import com.ruoyi.rural.service.IRuralVaccineAppointmentService;

/**
 * 疫苗预约Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-06
 */
@Service
public class RuralVaccineAppointmentServiceImpl implements IRuralVaccineAppointmentService 
{
    @Autowired
    private RuralVaccineAppointmentMapper ruralVaccineAppointmentMapper;

    /**
     * 查询疫苗预约
     * 
     * @param id 疫苗预约主键
     * @return 疫苗预约
     */
    @Override
    public RuralVaccineAppointment selectRuralVaccineAppointmentById(String id)
    {
        return ruralVaccineAppointmentMapper.selectRuralVaccineAppointmentById(id);
    }

    /**
     * 查询疫苗预约列表
     * 
     * @param ruralVaccineAppointment 疫苗预约
     * @return 疫苗预约
     */
    @Override
    public List<RuralVaccineAppointment> selectRuralVaccineAppointmentList(RuralVaccineAppointment ruralVaccineAppointment)
    {
        return ruralVaccineAppointmentMapper.selectRuralVaccineAppointmentList(ruralVaccineAppointment);
    }

    /**
     * 新增疫苗预约
     * 
     * @param ruralVaccineAppointment 疫苗预约
     * @return 结果
     */
    @Override
    public int insertRuralVaccineAppointment(RuralVaccineAppointment ruralVaccineAppointment)
    {
        ruralVaccineAppointment.setId(UUID.randomUUID().toString());
        ruralVaccineAppointment.setCreateTime(DateUtils.getNowDate());
        return ruralVaccineAppointmentMapper.insertRuralVaccineAppointment(ruralVaccineAppointment);
    }

    /**
     * 修改疫苗预约
     * 
     * @param ruralVaccineAppointment 疫苗预约
     * @return 结果
     */
    @Override
    public int updateRuralVaccineAppointment(RuralVaccineAppointment ruralVaccineAppointment)
    {
        ruralVaccineAppointment.setUpdateTime(DateUtils.getNowDate());
        return ruralVaccineAppointmentMapper.updateRuralVaccineAppointment(ruralVaccineAppointment);
    }

    /**
     * 批量删除疫苗预约
     * 
     * @param ids 需要删除的疫苗预约主键
     * @return 结果
     */
    @Override
    public int deleteRuralVaccineAppointmentByIds(String[] ids)
    {
        return ruralVaccineAppointmentMapper.deleteRuralVaccineAppointmentByIds(ids);
    }

    /**
     * 删除疫苗预约信息
     * 
     * @param id 疫苗预约主键
     * @return 结果
     */
    @Override
    public int deleteRuralVaccineAppointmentById(String id)
    {
        return ruralVaccineAppointmentMapper.deleteRuralVaccineAppointmentById(id);
    }
}
